package com.sdyeda.readiot.fx;

import java.io.IOException;

import com.sdyeda.readiot.ReadIotApplication;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Modality;
import javafx.stage.Stage;

public class SetAllWindow {
	private SetAllController setallcontroller;

	public SetAllController getSetallcontroller() {
		return setallcontroller;
	}

	public void setSetallcontroller(SetAllController setallcontroller) {
		this.setallcontroller = setallcontroller;
	}

	public SetAllWindow(Stage stage, Stage parentstage) {
		FXMLLoader loader = new FXMLLoader(getClass().getResource("SetAll.fxml"));
		loader.setControllerFactory(ReadIotApplication.springContext::getBean);
		try {
			stage.setScene(new Scene(loader.load()));

			stage.setTitle("尾矿库自动数据采集系统--通用设置");
			stage.getIcons().add(new Image(MainWindow.class.getResourceAsStream("/logo.png")));
			stage.initOwner(parentstage);
			stage.initModality(Modality.WINDOW_MODAL);
			stage.setResizable(false);

			setSetallcontroller(loader.getController());
			setallcontroller.setStage(stage);

		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
